Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  The number of possible min-heaps containing e... Start Learning for Free
The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.
  • a)
     80
  • b)
     8
  • c)
    20
  • d)
    210
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
The number of possible min-heaps containing each value from {1, 2, 3, ...
Set minimum element as root (i.e 1), now 6 are remaining and left subtree will have 3 elements, each left subtree combination can be permuted in 2! ways.
Total ways to design min-heap with 7-elements =  *2! * 2! = 20*2*2 = 80
Alternative approach – Total number of min or max heap tree with 1 to N elements are using recurrence relation:
► T(N) = (N-1)Ck * T(k) * T(N-k-1), where k = number of nodes on left subtree
► T(1) = 1 T(2) = 1 T(3) = 2 T(4) = 3C2 * T(2) * T(1) = 3 T(5) = 4C3 * T(3) * T(1) = 8 T(6) = 5C3 * T(3) * T(2) = 20 T(7) = 5C3 * T(3) * T(3) = 80
So, answer is 80.
View all questions of this test
Most Upvoted Answer
The number of possible min-heaps containing each value from {1, 2, 3, ...
Set minimum element as root (i.e 1), now 6 are remaining and left subtree will have 3 elements, each left subtree combination can be permuted in 2! ways.
Total ways to design min-heap with 7-elements =  *2! * 2! = 20*2*2 = 80
Alternative approach – Total number of min or max heap tree with 1 to N elements are using recurrence relation:
  • T(N) = (N-1)Ck * T(k) * T(N-k-1), were k = number of nodes on left subtree
  •  T(1) = 1 T(2) = 1 T(3) = 2 T(4) = 3C2 * T(2) * T(1) = 3 T(5) = 4C3 * T(3) * T(1) = 8 T(6) = 5C3 * T(3) * T(2) = 20 T(7) = 5C3 * T(3) * T(3) = 80
So, answer is 80.
Free Test
Community Answer
The number of possible min-heaps containing each value from {1, 2, 3, ...
Set minimum element as root (i.e 1), now 6 are remaining and left subtree will have 3 elements, each left subtree combination can be permuted in 2! ways.
Total ways to design min-heap with 7-elements =  *2! * 2! = 20*2*2 = 80
Alternative approach – Total number of min or max heap tree with 1 to N elements are using recurrence relation:
  • T(N) = (N-1)Ck * T(k) * T(N-k-1), were k = number of nodes on left subtree
  •  T(1) = 1 T(2) = 1 T(3) = 2 T(4) = 3C2 * T(2) * T(1) = 3 T(5) = 4C3 * T(3) * T(1) = 8 T(6) = 5C3 * T(3) * T(2) = 20 T(7) = 5C3 * T(3) * T(3) = 80
So, answer is 80.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Question Description
The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.a)80b)8c)20d)210Correct answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.a)80b)8c)20d)210Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.a)80b)8c)20d)210Correct answer is option 'A'. Can you explain this answer?.
Solutions for The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.a)80b)8c)20d)210Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.a)80b)8c)20d)210Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.a)80b)8c)20d)210Correct answer is option 'A'. Can you explain this answer?, a detailed solution for The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.a)80b)8c)20d)210Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.a)80b)8c)20d)210Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______.a)80b)8c)20d)210Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev